<template>
  <router-view />
</template>

<script>
import { defineComponent, onMounted } from 'vue'
// import { AppFullscreen } from 'quasar'
import { useUserStore } from "src/stores/modules/userStore";
export default defineComponent({
  name: 'App',

  setup() {
    const userStore = useUserStore();
    // userStore.init();
    let t;
    // ping_login 并获取系统时间
    const pingLogin = async () => {
      const res = await userStore.pingLogin();
      if (res.status === 200) {
        document.getElementById('date').innerHTML = res.data.date_time;
        let [h, m, s] =  res.data.date_time?.split(':')
        document.getElementById('date').innerHTML = h+":" + m;
      } else {
        window.getDate();
        window.startTime();
      }
    }
    onMounted(() => {
      t = setInterval(() => {
        pingLogin();
      }, 5000)
    })
    // AppFullscreen.request()
    //   .then(() => {
    //     console.log('start fullscreen')
    //   })
    //   .catch(err => {
    //     console.log('fail to start fullscreen', err)
    //   })

  }
})
</script>
